package com.langchain4j.simple.config;

import dev.langchain4j.data.message.ChatMessage;
import dev.langchain4j.store.memory.chat.ChatMemoryStore;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName RedisChatMemoryStore
 * @Description TODO
 * @createTime 18:00:00 2025/07/31
 */
@Component
public class RedisChatMemoryStore implements ChatMemoryStore {

    public static final String CHAT_MEMORY_PREFIX = "CHAT_MEMORY:";

//    private RedisTemplate<String, String> redisTemplate;

    @Override
    public List<ChatMessage> getMessages(Object memoryId) {
//        String retValue = redisTemplate.opsForValue().get(CHAT_MEMORY_PREFIX + memoryId);
//        return ChatMessageDeserializer.messagesFromJson(retValue);
        return null;
    }

    @Override
    public void updateMessages(Object memoryId, List<ChatMessage> list) {
//        redisTemplate.opsForValue().set(CHAT_MEMORY_PREFIX + memoryId, ChatMessageSerializer.messagesToJson(list));
    }

    @Override
    public void deleteMessages(Object memoryId) {
//        redisTemplate.delete(CHAT_MEMORY_PREFIX + memoryId);
    }
}
